


function request(url, params, type = "get"){
    return new Promise(function(resolve, reject){
        $.ajax({
            type:"get",
            url: url,
            data: {
                ...params
            },
            dataType: "json",
            success: function(result){
                resolve(result);
            },
            error: function(err){
                reject(err);
            }
        })
    })
}

/* const isExistUser = function(params = {}){
    return request("../php/isExistUser.php", params, "get");
} */

const isExistUser = (params = {}) => request("../php/isExistUser.php", params, "get");
const isExistPhone = (params = {}) => request("../php/isExistPhone.php", params, "get");
const isExistEmail = (params = {}) => request("../php/isExistEmail.php", params, "get");
const deleteGradeById = (params = {}) => request("../php/deleteGradeById.php", params, "get");
const login_account = (params = {}) => request("../php/login_account.php", params, "get");
const register = (params = {}) => request("../php/register.php", params, "get");
const searchAllGrade = (params = {}) => request("../php/searchAllGrade.php", params, "get");
const searchGradeById = (params = {}) => request("../php/searchGradeById.php", params, "get");
const searchGradeOrder = (params = {}) => request("../php/searchGradeOrder.php", params, "get");
const searchGradeOrderLimit = (params = {}) => request("../php/searchGradeOrderLimit.php", params, "get");
const updateGradeById = (params = {}) => request("../php/updateGradeById.php", params, "get");